
************************************************************************
* Replication material for "The Social Dynamics of Collective Action:  *
* Evidence from the Diffusion of the Swing Riots, 1830-31"             *
*                                                                      *
* Aidt, Leon and Satchell (2020)                                       *
************************************************************************

*************************************************************************
* Requires the use of reg2hdfespatial. The code can be found here:      *
* http://www.trfetzer.com/wp-content/uploads/reg2hdfespatial-id1id2.ado *
*************************************************************************



****************************************
* Table A3: Estimates using daily data *
****************************************

sysdir set PERSONAL "C:\Users\k1466170\Documents\ado"
sysdir set PLUS "C:\Users\k1466170\Documents\ado"

clear
clear matrix
clear mata
set maxvar 32000

use Swing_data_daily
set matsize 10000
set more off

*generate period vars
gen period=.
replace period=1 if week_number<49
replace period=2 if week_number>=49

gen par_period=period*100000+input_fid



* Column 1
reg2hdfespatial totriots L1riots_near L1totriots, timevar(time) panelvar(input_fid) lat(latitude) lon(longitude) distcutoff(10) disp
outreg2 using A3, tex(frag) auto(2) title(Daily data) asterisk(se) ctitle(Riots) lab replace alpha(0.001, 0.01, 0.05, 0.1) symbol(***,**,*,+) drop(_I*) addtext(Fixed effect, Parish, Time dummies, Weeks, Time trend, No, Standard errors, Conley, Estimation, OLS)

* Column 2
reg2hdfespatial totriots L1riots_near L1totriots, timevar(time) panelvar(input_fid) altfepanel(par_period) lat(latitude) lon(longitude) distcutoff(10) disp
outreg2 using A3, tex(frag) auto(2) ///
asterisk(se) ctitle(Riots) lab append alpha(0.001, 0.01, 0.05, 0.1) symbol(***,**,*,+) keep(L1* L2* L3*) addtext(Fixed effect, Parish, Time dummies, Weeks, Time trend, parish x period, Standard errors, Conley, Estimation, OLS)

* Column 3
reg2hdfespatial totriots L1riots_near L2riots_near L3riots_near L1totriots L2totriots L3totriots, timevar(time) panelvar(input_fid) altfepanel(par_period) lat(latitude) lon(longitude) distcutoff(10) disp
outreg2 using A3, tex(frag) auto(2) asterisk(se) ctitle(Riots) lab append alpha(0.001, 0.01, 0.05, 0.1) symbol(***,**,*,+) drop(_I*) addtext(Fixed effect, Parish, Time dummies, Weeks, Time trend, parish x period, Standard errors, Conley, Estimation, OLS)


